package com.liuyk.commonlib.transformer;

import com.google.gson.Gson;

public class GsonTransformer {

    public <T> T transform(Class<T> type, byte[] data) {
        Gson g = new Gson();
        try {
            return g.fromJson(new String(data), type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
